#!/usr/bin/env python

import rospy, os, sys
from sound_play.msg import SoundRequest
from sound_play.libsoundplay import SoundClient


class Sound:
	def __init__(self):
		#rospy.init_node('my_sound', anonymous=True)
		self.sound_handle = SoundClient()
		rospy.sleep(1)

	
	def say(self, sentence, slp=3):
		self.sound_handle.stopAll()
		self.sound_handle.say(sentence)
		rospy.sleep(slp)


if __name__ == '__main__':
	#rospy.init_node('my_sound', anonymous=True)
	#sound_handle = SoundClient()

	#rospy.sleep(1)

	#sound_handle.stopAll()

	#print 'say'
	#sound_handle.say('Hello World')
	#rospy.sleep(3)

	sound = Sound()
	sound.say('I have detected the traffic lights', 2)

